function ah = setAxesPosition(fhandle, position, nplots)

global PLOT_FOR_WEB PLOT_WIDTH PLOT_HEIGHT

if(PLOT_FOR_WEB)
    % Set axes position for web
    left = 0;
    width = PLOT_WIDTH;
    height = PLOT_HEIGHT / 3;
    
    left_pos = 0.1 * width;
    width_pos = width - (0.134 * width);
    height_pos = height * 0.55;    
        
    if(nplots == 3)
        switch position
            case 1
                bottom = 0;
            case 2
                bottom = 0.295 * PLOT_HEIGHT;
            otherwise
                bottom = 0.595 * PLOT_HEIGHT;
        end
    end

    if(nplots == 2)
        switch position
            case 1
                bottom = 0.142 * PLOT_HEIGHT;        
            otherwise
                bottom = 0.476 * PLOT_HEIGHT;
        end
    end

    if(nplots == 1)
       bottom = PLOT_HEIGHT / 3; 
    end
    
    bottom_pos = bottom + (PLOT_HEIGHT * 0.095);
    set(fhandle(), 'Units', 'pixels');
    set(fhandle(), 'OuterPosition', [left bottom width height]);
    set(fhandle(), 'Position', [left_pos bottom_pos width_pos height_pos]);
else 
    % Set axes position for printing
    left = 0;
    width = 29;
    height = 7;


    if(nplots == 3)
        switch position
            case 1
                bottom = 0;
            case 2
                bottom = 6.2;
            otherwise
                bottom = 12.5;
        end
    end

    if(nplots == 2)
        switch position
            case 1
                bottom = 3;        
            otherwise
                bottom = 10;
        end
    end

    if(nplots == 1)
       bottom = 7; 
    end   
    
    set(fhandle(), 'Units', 'centimeters');
    set(fhandle(), 'OuterPosition', [left bottom width height]);
    set(fhandle(), 'Position', [left+2 bottom+2 width-4 height-3]);
end

ah = fhandle;
